home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / powerd / examples / AppMenuItem.d < prev    next >
Encoding:
Text File  |  1999-09-30  |  651 b   |  26 lines

  1. /* AppMenuItem.d, loosely adapted from RKRM libraries 3rd ed. */
  2. /* translated from AppMenuItem.e */
  3.  
  4. OPT OSVERSION=37,NOSTD
  5.  
  6. MODULE 'wb'
  7.  
  8. DEF    myport,appitem,appmsg,WorkbenchBase
  9.  
  10. PROC main()
  11.     IF WorkbenchBase:=OpenLibrary('workbench.library',37)
  12.         IF myport:=CreateMsgPort()
  13.             IF appitem:=AddAppMenuItemA(0,0,'DisplayBeep()',myport,NIL)
  14.                 PrintF('Come on, go and see whats in the Tools menu ...\n')
  15.                 WaitPort(myport)
  16.                 DisplayBeep(NIL)
  17.                 PrintF('Wow, you found it!\n')
  18.                 RemoveAppMenuItem(appitem)
  19.                 WHILE appmsg:=GetMsg(myport) DO ReplyMsg(appmsg)
  20.             ENDIF
  21.             DeleteMsgPort(myport)
  22.         ENDIF
  23.         CloseLibrary(WorkbenchBase)
  24.     ENDIF
  25. ENDPROC
  26.